#ifndef ARROW_H
#define ARROW_H

#include "Globals.h"
#include "GameElement.h"
#include "Man.h"

/*! \class Arrow
 *  \brief Dig Dug's weapon. A model of the harpoon
 *
 *  This class inherits from GameElement
 *
 *  \author Jackline Atsango
 *  \author Jean pierre vieira Pereira
 *  \version 3
 *  \date 26 September 2012
 */

using namespace std;

class Arrow: public GameElement
{
    public:

/*! \fn Arrow
 *  \brief create an arrow object
 *  \param dig_dug an object from class Man
 */
        Arrow(shared_ptr<Man > dig_dug);

/*! \fn void initialise
 *  \brief sets the starting position and ID of the arrow object
 */
        void initialise();

/*! \fn void update
 *  \brief increment or decrement the arrow
 *
 *  Data member arrowexpand has a stretch limit. If the arrow is to expand and
 *  the stretch limit has not been reached, arrowexpand is incremented. When the stretch
 *  limit is reached, the arrow can only contract and arrowexpand is decremented.
 *  if arrowexpand is zero, data member expandable is set to true.
 */
        void update();

/*! \fn void update_head_pos
 *  \brief updates the direction in which the arrow should expand
 */
        void update_head_pos();

/*! \fn bool check_collision
 *  \param monster_pos_x x coordinate
 *  \param monster_pos_y y coordinate
 *  \brief checks if arrow overlaps monster
 *  \returns true if collided and false otherwise
 */
        bool check_collision(int monster_pos_x, int monster_pos_y);

/*! \fn void set_expand
 *  \brief sets data member expand to true
 *  Data member expandable is then set to false.
 */
        void set_expand();

 /*! \fn bool get_invisible
 *  \brief the arrow can not be seen if arrowexpand is zero
 *  \returns boolean invisible status
 */
        bool get_invisible();

/*! \fn double get_arrowExpand
 *  \returns double value of the stretch of the arrow
 */
        double get_arrowExpand();

    private:

        shared_ptr<Man > _DigDug;

        double _arrowExpand;

        bool _invisible;
        bool _expandable;
        bool _expand;
        bool _contract;
        int _shootDirection;

        int _arrowHead_posX;
        int _arrowHead_posY;

};

#endif // ARROW_H
